<?php
declare (strict_types = 1);

namespace app\admin\validate\maichen;

use think\Validate;

class Purchase extends Validate
{
    /**
     * 定义验证规则
     * 格式：'字段名'	=>	['规则1','规则2'...]
     *
     * @var array
     */	
	protected $rule = [
        'name' => ['require',],
        'material' => ['require',],
        'manufacturer' => ['require',],
        'buying_price' => ['require'],
        'price_adjustment_date' => ['require'],
        'num' => ['require'],
        'box_gauge' => ['require'],
    ];
    
    /**
     * 定义错误信息
     * 格式：'字段名.规则名'	=>	'错误信息'
     *
     * @var array
     */	
    protected $message = [
        'name.require' => '商品名称是必选项',
        'material.require' => '材质是必选项',
        'manufacturer.require' => '厂家是必选项',
        'shop_no.require' => '店管家号是必选项',
        'name.length' => '商品名称必须在 4 到 25 个字符之间',
        'material.length' => '材质必须在 2 到 18 个字符之间',
        'manufacturer.length' => '厂家必须在 2 到 18个字符之间',
        'shop_no.length' => '店管家号必须是11位',
        'num.require' => '数量不能为空',
        'box_gauge' => '箱规不能为空',
    ];
}
